package cn.xxstudy.visitshop.adapter

import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.paging.LoadState
import androidx.paging.LoadStateAdapter
import androidx.recyclerview.widget.RecyclerView
import cn.xxstudy.visitshop.R
import cn.xxstudy.visitshop.databinding.ItemFooterBinding
import cn.xxstudy.visitshop.util.FooterState
import cn.xxstudy.visitshop.util.FooterStateData

/**
 * @author ：DELL on 2021/3/26 .
 * @packages ：cn.xxstudy.visitshop.adapter .
 * TODO:配合Paging的底部footerView
 */
class HeaderAdapter : LoadStateAdapter<HeaderAdapter.HeaderViewHolder>() {

    override fun onBindViewHolder(holder: HeaderViewHolder, loadState: LoadState) {
        Log.d(
            "HeaderAdapter",
            "onBindViewHolder(HeaderAdapter.java:24): ${loadState.toString()}"
        )
    }


    override fun onCreateViewHolder(parent: ViewGroup, loadState: LoadState): HeaderViewHolder {
        Log.d("HeaderAdapter",
            "onCreateViewHolder(HeaderAdapter.java:32): ")
        val view = LayoutInflater.from(parent.context).inflate(R.layout.item_header, parent, false)
        return HeaderViewHolder(view)
    }

    inner class HeaderViewHolder(rootView: View) : RecyclerView.ViewHolder(rootView)
}